Routines (alphabetical) > Routines: D > DERIV

DERIV

Syntax | Return Value | Arguments | Examples | Version History | See Also

The DERIV function performs numerical differentiation using 3-point, Lagrangian interpolation.

This routine is written in the IDL language. Its source code can be found in the file deriv.pro in the lib subdirectory of the IDL distribution.

Syntax

Result = DERIV([X,] Y)

Return Value

Returns the derivative of the numerical differentiation.

Arguments

X

Differentiate with respect to this variable. If omitted, unit spacing for Y (i.e., Xi = i) is assumed.

Y

The variable to be differentiated.

Examples

X = [ 0.1, 0.3, 0.4, 0.7, 0.9]
Y = [ 1.2, 2.3, 3.2, 4.4, 6.6]
PRINT, DERIV(Y)
PRINT, DERIV(X,Y)

IDL prints:

1.20000   1.00000   1.05000   1.70000   2.70000

3.16666   7.83333   7.75000   8.20000   13.8000

Version History

Original

Introduced

See Also

DERIVSIG